<?php
require_once("lib/auth/session.php");
require_once("lib/sqlConnector.php");
require_once("lib/img/imageHandler.php");
// Creates post in DB
function createPost($subject, $content, $rating, $img) {
    $userid =$GLOBALS['USERID'];
	$postid = sqlQuery("INSERT INTO posts (userid, subject, content, rating, img) VALUES ('%s','%s','%s', '%s', '%s')",
	    array($userid,$subject,$content,$rating,$img), TRUE);
   	saveImage($img, $postid);
    return $postid;
}
?>
